package com.ruoyi.system.support;

import okhttp3.*;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
@Service
public class OldScmApiSupport {
    public String callPostApiGetFKListByDeviceId() throws Exception {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse("text/plain");
        MultipartBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
                .addFormDataPart("v_2","M3606")
                .addFormDataPart("v_1","1")
                .addFormDataPart("u_3","253238612e6a6c5f736a253345253344253237323032352d31312d3031253230303025334130302533413030253237253239253230616e64253230253238612e6a6c5f736a253343253344253237323032352d31312d3330253230323325334135392533413539253237253239253230616e64253230253238622e61636465705f73657269616c253344323030303133253239")
                .addFormDataPart("posStart","0")
                .addFormDataPart("count","10000")
                .build();
        Request request = new Request.Builder()
                .url("http://10.77.18.10:7899/scm-mjreal/ja/ja/ja/main_xml/dgrid/YY.YY3-668.asp")
                .method("POST", body)
                .addHeader("Cookie", "wedsmain=bsv5_language%3D%3Dcn; RJTFTYHZXLNCCQLHLUAN=KJLKROVOGCCSSRTFMOKSEEBVVDACTXHISBVCZQMM; FLQIXIEFLKKPBXORTTXC=KEAZZYTEYLKVHJIOFLAKWZOZBAMPTKHHJHCMJLHD; TYCYTMSKZAQWPDJFFFPY=KTYIIIFPGPBCURHXVXFIBEJETGUQFQPJUPTVTVSZ; FSIABGJCKMQJDXZLXGIL=BYUFKRLDPXRGNCRMLIGJHYHUYYEKWUAQURSIRSRP; wedsnow=bsv5_date_start%3D%3D2025/11/01%7Cbsv5_date_end%3D%3D2025/11/30%7Cbsv5_date_format%3D%3Dyyyy/MM/dd%7Cbsv5_dep_select%3D%3D%7Cbsv5_dep_checked%3D%3D%7Cbsv5_login%3D%3Dadmin%7Cbsv5_reg%3D%3Dundefined%7Cbsv5_acdep_checked%3D%3D%7Cbsv5_acdep_select%3D%3D200020%7Cbsv5_date_on%3D%3D2025/11/01%2000%3A00%3A00%7Cbsv5_date_down%3D%3D2025/11/30%2023%3A59%3A59%7Cbsv5_acuser_select%3D%3D%7Cbsv5_user_select%3D%3D")
                .build();
        Response response = client.newCall(request).execute();

        return response.body().toString();
    }
}
